package com.food.user.util;

public class RedisKeyUtil {
    //储存1分钟内是否发送过的redisKey
    public static String onMinuteCodeKey(String phone){
        return "register:codeonminute:phone:"+phone;
    }

    //储存1小时内的redisKey次数
    public static String onHourCodeKey(String phone){
        return "register:codeonhour:phone:"+phone;
    }
    //手机号登录
    public static String loginByPhone(String phone){
        return "login:phone:"+phone;
    }
    //手机号注册
    public static String registerByPhone(String phone){
        return "register:phone:"+phone;
    }

    //自动接单配置次数
    public static String AutoReceive(String key){
        return "restrain:autoreceive:userid:"+key;
    }

    //修改营业状态次数
    public static String storeState(String key){
        return "restrain:storestate:userid:"+key;
    }

    /**
     * 用户的购物车列表的Rediskey 看用户有哪些购物清单里面
     */
    public static String userCartKey(Integer userId)throws Exception{
        return "cart:userid:"+userId;
    }
    /**
     * 具体那一条购物车记录的Rediskey
     */
    public static String cartInfoKey(String cartId)throws Exception{
        return "cart:cartId:"+cartId;
    }

    public static String typeCache(){
        return "cache:products";
    }
}
